/**
 * 设置视角图标
 * @param ratio 画布大小比例
 * @param color 颜色
 * @returns 数据地址
 */
const ResetSightImage = (radio?:number,color?:string)=> {
    const r=radio||2;
    const col=color||'#ffffff';
    const canvas=document.createElement('canvas');
    canvas.width=canvas.height=32*r;
    const ctx=canvas.getContext('2d')!;
    ctx.save();
    ctx.strokeStyle="rgba(0,0,0,0)";
    ctx.miterLimit=4;
    ctx.font="15px ''";
    ctx.fillStyle=col;
    ctx.font="   15px ''";
    ctx.scale(0.03,0.03);
    ctx.save();
    ctx.font="   15px ''";
    ctx.beginPath();
    ctx.moveTo(510*r,434.3*r);
    ctx.bezierCurveTo(476.5*r,434.3*r,449.2*r,461.3*r,449.2*r,494.5*r);
    ctx.bezierCurveTo(449.2*r,527.7*r,476.4*r,554.7*r,510*r,554.7*r);
    ctx.bezierCurveTo(543.5*r,554.7*r,570.7*r,527.7*r,570.7*r,494.50000000000006*r);
    ctx.bezierCurveTo(570.7*r,461.30000000000007*r,543.5*r,434.30000000000007*r,510.00000000000006*r,434.30000000000007*r);
    ctx.moveTo(509.9*r,673.2*r);
    ctx.bezierCurveTo(410.7*r,673.2*r,329.9*r,593*r,329.9*r,494.50000000000006*r);
    ctx.bezierCurveTo(329.9*r,396.0000000000001*r,410.7*r,315.80000000000007*r,509.9*r,315.80000000000007*r);
    ctx.bezierCurveTo(609.1999999999999*r,315.80000000000007*r,690*r,396.00000000000006*r,690*r,494.50000000000006*r);
    ctx.bezierCurveTo(690*r,593*r,609.2*r,673.2*r,509.9*r,673.2*r);
    ctx.closePath();
    ctx.moveTo(509.9*r,372.30000000000007*r);
    ctx.bezierCurveTo(441.79999999999995*r,372.30000000000007*r,386.29999999999995*r,427.20000000000005*r,386.29999999999995*r,494.6000000000001*r);
    ctx.bezierCurveTo(386.29999999999995*r,562.0000000000001*r,441.69999999999993*r,616.9000000000001*r,509.9*r,616.9000000000001*r);
    ctx.bezierCurveTo(578.1*r,616.9000000000001*r,633.5*r,562.0000000000001*r,633.5*r,494.6000000000001*r);
    ctx.bezierCurveTo(633.5*r,427.20000000000005*r,578.1*r,372.30000000000007*r,509.9*r,372.30000000000007*r);
    ctx.closePath();
    ctx.moveTo(509.9*r,735.4*r);
    ctx.bezierCurveTo(414.79999999999995*r,735.4*r,316.4*r,702.4*r,217.39999999999998*r,637.3*r);
    ctx.bezierCurveTo(204.39999999999998*r,628.6999999999999*r,200.79999999999998*r,611.3*r,209.29999999999998*r,598.1999999999999*r);
    ctx.bezierCurveTo(217.89999999999998*r,585.1999999999999*r,235.29999999999998*r,581.5999999999999*r,248.39999999999998*r,590.0999999999999*r);
    ctx.bezierCurveTo(338*r,649.2*r,426*r,679*r,509.9*r,679*r);
    ctx.bezierCurveTo(686.3*r,679*r,838.5999999999999*r,544.7*r,889.4*r,494.5*r);
    ctx.bezierCurveTo(838.5*r,444.3*r,685.9*r,310*r,509.9*r,310*r);
    ctx.bezierCurveTo(294*r,310*r,114.2*r,511.1*r,112.5*r,513.1*r);
    ctx.bezierCurveTo(102.2*r,524.8000000000001*r,84.4*r,525.9*r,72.7*r,515.6*r);
    ctx.bezierCurveTo(61*r,505.3*r,59.900000000000006*r,487.5*r,70.2*r,475.8*r);
    ctx.bezierCurveTo(78.2*r,466.7*r,268.8*r,253.5*r,510*r,253.5*r);
    ctx.bezierCurveTo(751.2*r,253.5*r,941.8*r,466.7*r,949.8*r,475.8*r);
    ctx.bezierCurveTo(959.1999999999999*r,486.5*r,959.1999999999999*r,502.40000000000003*r,949.8*r,513.1*r);
    ctx.bezierCurveTo(941.6999999999999*r,522.2*r,751.0999999999999*r,735.4000000000001*r,509.9*r,735.4000000000001*r);
    ctx.closePath();
    ctx.fill();
    ctx.stroke();
    ctx.restore();
    ctx.restore();
    return canvas.toDataURL('image/png');
};


export {ResetSightImage};